// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information.
//
// ███╗   ██╗ ██████╗ ████████╗██╗ ██████╗███████╗
// ████╗  ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝
// ██╔██╗ ██║██║   ██║   ██║   ██║██║     █████╗
// ██║╚██╗██║██║   ██║   ██║   ██║██║     ██╔══╝
// ██║ ╚████║╚██████╔╝   ██║   ██║╚██████╗███████╗
// ╚═╝  ╚═══╝ ╚═════╝    ╚═╝   ╚═╝ ╚═════╝╚══════╝
// ------------------------------------------------
//
// This file is automatically generated.
// Please do not edit these files manually.
//
// ------------------------------------------------

#nullable restore

using Elastic.Clients.Elasticsearch.Fluent;
using Elastic.Clients.Elasticsearch.Requests;
using Elastic.Clients.Elasticsearch.Serialization;
using Elastic.Transport;
using System;
using System.Collections.Generic;
using System.Linq.Expressions;
using System.Text.Json;
using System.Text.Json.Serialization;

namespace Elastic.Clients.Elasticsearch.MachineLearning;

public sealed partial class ClearTrainedModelDeploymentCacheRequestParameters : RequestParameters
{
}

/// <summary>
/// <para>Clears a trained model deployment cache on all nodes where the trained model is assigned.<br/>A trained model deployment may have an inference cache enabled.<br/>As requests are handled by each allocated node, their responses may be cached on that individual node.<br/>Calling this API clears the caches without restarting the deployment.</para>
/// </summary>
public sealed partial class ClearTrainedModelDeploymentCacheRequest : PlainRequest<ClearTrainedModelDeploymentCacheRequestParameters>
{
	public ClearTrainedModelDeploymentCacheRequest(Elastic.Clients.Elasticsearch.Id modelId) : base(r => r.Required("model_id", modelId))
	{
	}

	internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningClearTrainedModelDeploymentCache;

	protected override HttpMethod StaticHttpMethod => HttpMethod.POST;

	internal override bool SupportsBody => false;

	internal override string OperationName => "ml.clear_trained_model_deployment_cache";
}

/// <summary>
/// <para>Clears a trained model deployment cache on all nodes where the trained model is assigned.<br/>A trained model deployment may have an inference cache enabled.<br/>As requests are handled by each allocated node, their responses may be cached on that individual node.<br/>Calling this API clears the caches without restarting the deployment.</para>
/// </summary>
public sealed partial class ClearTrainedModelDeploymentCacheRequestDescriptor : RequestDescriptor<ClearTrainedModelDeploymentCacheRequestDescriptor, ClearTrainedModelDeploymentCacheRequestParameters>
{
	internal ClearTrainedModelDeploymentCacheRequestDescriptor(Action<ClearTrainedModelDeploymentCacheRequestDescriptor> configure) => configure.Invoke(this);

	public ClearTrainedModelDeploymentCacheRequestDescriptor(Elastic.Clients.Elasticsearch.Id modelId) : base(r => r.Required("model_id", modelId))
	{
	}

	internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningClearTrainedModelDeploymentCache;

	protected override HttpMethod StaticHttpMethod => HttpMethod.POST;

	internal override bool SupportsBody => false;

	internal override string OperationName => "ml.clear_trained_model_deployment_cache";

	public ClearTrainedModelDeploymentCacheRequestDescriptor ModelId(Elastic.Clients.Elasticsearch.Id modelId)
	{
		RouteValues.Required("model_id", modelId);
		return Self;
	}

	protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings)
	{
	}
}